<p:document xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://jboss.com/products/seam/pdf"
	xmlns:s="http://jboss.com/products/seam/taglib"
	title="#{course.name} Scorecard"
	orientation="landscape">
	<p:image value="#{course.facility.logo}"
		rendered="#{course.facility.logo != null}">
		<s:transformImageSize height="96" maintainRatio="true"/>
	</p:image>
	<p:font size="18">
		<p:paragraph>#{course.name}</p:paragraph>
	</p:font>
	<p:font size="8" color="darkgray">
		<p:paragraph spacingAfter="6">Designed by #{course.designer}</p:paragraph>
	</p:font>
	<p:font size="8">
		<p:table columns="22" widthPercentage="100" headerRows="1"
			widths="3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1">
			<f:facet name="defaultCell">
				<p:cell padding="5" noWrap="true"
					horizontalAlignment="center" verticalAlignment="middle"/>
			</f:facet>
			<p:font size="8" color="white" style="bold">
				<p:cell horizontalAlignment="left" grayFill=".25">
					<p:paragraph>Hole</p:paragraph>
				</p:cell>
				<ui:repeat var="_holeNum" value="#{scorecard.holeNumbersOut}">
					<p:cell grayFill=".25">
						<p:paragraph>#{_holeNum}</p:paragraph>
					</p:cell>
				</ui:repeat>
				<p:cell grayFill=".25"><p:paragraph>Out</p:paragraph></p:cell>
				<ui:repeat var="_holeNum" value="#{scorecard.holeNumbersIn}">
					<p:cell grayFill=".25">
						<p:paragraph>#{_holeNum}</p:paragraph>
					</p:cell>
				</ui:repeat>
				<p:cell grayFill=".25"><p:paragraph>In</p:paragraph></p:cell>
				<p:cell grayFill=".25"><p:paragraph>Total</p:paragraph></p:cell>
			</p:font>
			<ui:repeat var="_ts" value="#{scorecard.mensAndUnisexTeeSets}">
				<p:font size="8" color="#{scorecard.fontColor(_ts.color)}">
					<p:cell horizontalAlignment="left"
						backgroundColor="#{scorecard.bgColor(_ts.color)}">
						<p:paragraph>#{_ts.name}</p:paragraph>
					</p:cell>
					<ui:repeat var="_tee" value="#{scorecard.getTeesOut(_ts)}">
						<p:cell backgroundColor="#{scorecard.bgColor(_ts.color)}">
							<p:paragraph>#{_tee.distance}</p:paragraph>
						</p:cell>
					</ui:repeat>
					<p:cell backgroundColor="#{scorecard.bgColor(_ts.color)}">
						<p:paragraph>#{_ts.distanceOut}</p:paragraph>
					</p:cell>
					<ui:repeat var="_tee" value="#{scorecard.getTeesIn(_ts)}">
						<p:cell backgroundColor="#{scorecard.bgColor(_ts.color)}">
							<p:paragraph>#{_tee.distance}</p:paragraph>
						</p:cell>
					</ui:repeat>
					<p:cell backgroundColor="#{scorecard.bgColor(_ts.color)}">
						<p:paragraph>#{_ts.distanceIn}</p:paragraph>
					</p:cell>
					<p:cell backgroundColor="#{scorecard.bgColor(_ts.color)}">
						<p:paragraph>#{_ts.totalDistance}</p:paragraph>
					</p:cell>
				</p:font>
			</ui:repeat>
			<p:font size="8" style="bold">
				<p:cell horizontalAlignment="left" grayFill=".9">
					<p:paragraph>Par</p:paragraph>
				</p:cell>
				<ui:repeat var="_hole" value="#{scorecard.holesOut}">
					<p:cell grayFill=".9">
						<p:paragraph>#{_hole.mensPar}</p:paragraph>
					</p:cell>
				</ui:repeat>
				<p:cell grayFill=".9">
					<p:paragraph>#{course.mensParOut}</p:paragraph>
				</p:cell>
				<ui:repeat var="_hole" value="#{scorecard.holesIn}">
					<p:cell grayFill=".9">
						<p:paragraph>#{_hole.mensPar}</p:paragraph>
					</p:cell>
				</ui:repeat>
				<p:cell grayFill=".9">
					<p:paragraph>#{course.mensParIn}</p:paragraph>
				</p:cell>
				<p:cell grayFill=".9">
					<p:paragraph>#{course.totalMensPar}</p:paragraph>
				</p:cell>
			</p:font>
		</p:table>
	</p:font>
</p:document>
